package com.onesports.intelligent.k12.polarlight.mapper.sys;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.onesports.intelligent.k12.polarlight.cache.MybatisRedisCache;
import com.onesports.intelligent.k12.polarlight.domain.entity.sys.Resource;
import org.apache.ibatis.annotations.CacheNamespace;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 资源表
 *
 * @author
 * @since 1.0.0 2022-02-11
 */
@Mapper
@CacheNamespace(implementation = MybatisRedisCache.class, eviction = MybatisRedisCache.class)
public interface ResourceMapper extends BaseMapper<Resource> {
    /**
     * 按用户查询资源
     *
     * @param accountId
     * @param systemCode 可空
     * @return
     */
    @Options(useCache = false)
    List<Resource> listByAccountId(@Param("accountId") String accountId, @Param("systemCode") String systemCode);

    /**
     * 按系统/终端查询资源
     *
     * @param systemCode
     * @return
     */
    List<Resource> listBySystemCode(@Param("systemCode") String systemCode);

}
